package com.hannesdorfmann.mosby3.mvi.integrationtest.lifecycle.componetcotainer;

import com.hannesdorfmann.mosby3.mvi.integrationtest.lifecycle.LifecycleTestPresenter;
import com.hannesdorfmann.mosby3.mvi.integrationtest.lifecycle.LifecycleTestView;
import com.hannesdorfmann.mosby3.mvi.layout.MviStackLayout;
import ohos.agp.components.AttrSet;
import ohos.agp.components.Component;
import ohos.app.Context;

public class ComponentContainerFinishOnStartLayout extends MviStackLayout<LifecycleTestView, LifecycleTestPresenter> implements LifecycleTestView {

    public LifecycleTestPresenter presenter;
    public int createPresenterInvocations;

    public ComponentContainerFinishOnStartLayout(Context context, AttrSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onAttachedToWindowDo(Component component) {

    }

    @Override
    protected void onDetachedFromWindowDo(Component component) {

    }

    @Override
    public LifecycleTestPresenter createPresenter() {
        createPresenterInvocations++;
        presenter = new LifecycleTestPresenter();
        return presenter;
    }
}
